#include "test.h"

void test()
{
	SListNode* x = BuySListNode(1);
	SListPrint(x);
	SListInsertAfter(x, 2);
	SListInsertAfter(x, 3);
	SListInsertAfter(x, 4);
	SListPrint(x);
	SListPushBack(x, 5);
	SListPrint(x);
	SListPushFront(&x, 9);
	SListPrint(x);
	SListPopBack(&x);
	SListPopBack(&x);
	SListPopBack(&x);
	//SListPopBack(&x);
	//SListPopBack(&x);
	//SListPopBack(&x);
	SListPrint(x);

	SListPopFront(&x);
	//SListPopFront(&x);
	//SListPopFront(&x);

	SListPrint(x);

	SListNode* result = SListFind(x, 4);
	if (result != NULL)
		printf("%d\n", result->data);
	else
		printf("%d Is Not Found!\n", 4);
	result = SListFind(x, 6);
	if (result != NULL)
		printf("%d\n", result->data);
	else
		printf("%d Is Not Found!\n", 6);
	result = SListFind(x, 1);
	if (result != NULL)
		printf("%d\n", result->data);
	else
		printf("%d Is Not Found!\n", 1);
	SListPushBack(x, 10);
	SListPushBack(x, 11);
	SListPrint(x);
	SListPushBack(x, 8);
	SListPushBack(x, 9);
	SListPrint(x);
	SListPrint(x);
	x = chkPalindrome(x);
	SListPrint(x);
}

int main()
{
	test();
	return 0;
}